package com.mouse.hxsj.entity.enums;

import com.mouse.damo.micro.Press;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
public enum BaseKey {
    tab(Press.TAB),
    num9(Press.NUM_9),
    num0(Press.NUM_0),
    f5(Press.F5),
    f6(Press.F6),
    ;
    @Getter
    private int keyNum;

    @Override
    public String toString() {
        return name();
    }

    public static String getNameByKeyNum(Integer num) {
        for (BaseKey baseKey : values()) {
            if (baseKey.getKeyNum() == num) {
                return baseKey.name();
            }
        }
        return null;
    }
}
